# -*- coding: utf-8 -*-

import requests
import bs4

# 获取网页
url = 'http://www.zjc.zjut.edu.cn/'
# 头信息
headers = {'User-Agent': ''}
resp = requests.get(url, headers=headers)
# 构造BeautifulSoup对象、获取目标Tag对象，及相关信息

soup = bs4.BeautifulSoup(resp.text, "lxml") # < Tag
title = soup.find('title') # Tag

# <li class="dropdown" id="dl_1">...学院概况...</li>

# x = soup.find('li', class_="dropdown" id="dl_1") # 1
x = soup.find('li', {"class": "dropdown", "id": "dl_1"})
x = x.find('a') # x.a # 2
print(x.text)



# url = 'http://www.zjc.zjut.edu.cn/l11_62'

# headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) Gecko/20100101 Firefox/57.0'}
# response = requests.get(url, headers=headers)

# # 构造BeautifulSoup对象、获取目标Tag对象，及相关信息
# soup = bs4.BeautifulSoup(response.text, "lxml")
# title = soup.find('div', {'id': 'mlist'})
# for l in title.find_all('div', {'class':'list'}):
#     print(l.text)

